fix(mobile): push gating and personal-team hardening for Android PR#3643
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Needs human review This PR propagates a new configuration flag to gate push notification features across multiple code paths. While the implementation is clean, changes that control whether significant functionality (notifications, live activities) is enabled or disabled warrant human review due to their behavioral impact. You can customize Macroscope's approvability policy. Learn more. |
1053338 to
2ae9365
Compare
4c5185e to
7be02cf
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7be02cf. Configure here.
- Validate T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID as a reverse-DNS identifier - Expose extra.iosPersonalTeamBuild so runtime capability gating works - Gate native APNs token acquisition on supportsAgentAwarenessPush() so Personal Team builds never call getDevicePushTokenAsync without the aps-environment entitlement - Document why appleSignIn gating on the Clerk plugin is load-bearing - Restore react-native-keyboard-controller 1.21.7 (main bumped it in #3545; 1.21.6 here was a stale pin) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
35f5c13 to
319117c
Compare
7be02cf to
49f5f1d
Compare
…3643) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…3643) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…3643) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

PR into #3579 carrying the fixes from #3575 that its snapshot of that branch missed (it absorbed an older version of
fix/mobile-device-builds-and-android-ui).What's included
Push registration gating for Personal Team builds (cherry-picked from #3575's
2e5b83f4c):agent-awareness/capabilities.tswithsupportsAgentAwarenessPush(), driven byextra.iosPersonalTeamBuildliveActivitiesEnabled/notificationsEnabledoff when push is unsupported (+ test)Hardening on top:
nativePushTokenRegistrationnow also checkssupportsAgentAwarenessPush(), so Personal Team builds never callgetDevicePushTokenAsync()without theaps-environmententitlement (previously only the payload was gated — a build with previously-granted permission would still attempt token acquisition and could stall waiting ondidRegisterForRemoteNotifications)T3CODE_IOS_PERSONAL_TEAM_BUNDLE_IDvalidated as a reverse-DNS identifier instead of just non-emptyextra.iosPersonalTeamBuildexposed in the Expo config (required for the runtime gating above)appleSignIn: !isIosPersonalTeamBuildgate on the Clerk plugin is load-bearing (the.cjsentitlements plugin runs before plugins earlier in the array, so it can't strip Clerk's entitlement)react-native-keyboard-controller1.21.7 — main bumped it in [codex] Upgrade Legend List chat scrolling #3545; the 1.21.6 pin here is a stale carryover that would silently downgrade it at mergeVerification
tsc --noEmitpassesSupersedes #3575, which is now closed.
🤖 Generated with Claude Code
Note
Gate push notifications and disable notification settings for Personal Team Android builds
supportsAgentAwarenessPushutility that returnsfalsewheniosPersonalTeamBuildis set in Expo config extras, used as a single gate across the push registration flow.nativePushTokenRegistrationshort-circuits without requesting permissions or an APNs token, returning{ notificationsEnabled: false, pushToken: null }for Personal Team builds.liveActivitiesEnabledandnotificationsEnabledtofalsein Personal Team builds viamakeRelayDeviceRegistrationRequest.SettingsRouteScreenare disabled and forced off when push is unavailable.app.config.tsthat rejects missing or non-reverse-DNS values whenT3CODE_IOS_PERSONAL_TEAM=1.Macroscope summarized 49f5f1d.
Note
Low Risk
Targeted mobile build-variant gating with tests; no auth or server contract changes beyond reporting push prefs as disabled.
Overview
Personal Team iOS builds (no
aps-environment/ push entitlements) now treat agent-awareness push as unavailable end-to-end instead of only lying in the relay payload.extra.iosPersonalTeamBuildis set in Expo config fromT3CODE_IOS_PERSONAL_TEAM=1, andsupportsAgentAwarenessPush()incapabilities.tsis the runtime switch.nativePushTokenRegistrationreturns early without callinggetDevicePushTokenAsync()or permission reads, avoiding stalls ondidRegisterForRemoteNotifications. Relay registration viamakeRelayDeviceRegistrationRequestforcesnotificationsEnabledandliveActivitiesEnabledoff when push is unsupported. Settings Device Notifications and Live Activity toggles are disabled and shown off on those builds.Build-time hardening:
T3CODE_IOS_PERSONAL_TEAM_BUNDLE_IDmust match a reverse-DNS pattern (not merely non-empty). A comment documents whyappleSignIn: !isIosPersonalTeamBuildon@clerk/expomust stay—the personal-team entitlements plugin cannot strip Clerk’s Sign in with Apple entitlement.Reviewed by Cursor Bugbot for commit 49f5f1d. Bugbot is set up for automated code reviews on this repo. Configure here.